import Render from '@views/live/cc/common/render'
import Utils from '@views/live/cc/common/utils'

class BroadChatMsg extends Render {
  constructor() {
    super()

    this.content = ''
    this.id = ''
  }

  set info(v) {
    if (!v) return
    this.content = v.content
    this.id = v.id
    this.appendMsg()
  }

  get HtmlContent() {
    return `<p class="msg-admin">系统消息：${Utils.showEm(this.content)}</p>`
  }

  appendMsg() {
    let li = this.createNode('li')
    li.className = `chat-content-wrap`
    li.setAttribute('id', this.id)
    this.innerHTML(li, this.HtmlContent)
    this.appendChild('chat-container', li)
  }
}

export default BroadChatMsg
